API

This API documentation covers each model within NLP Architect. Most modules have a corresponding user guide section that introduces the main concepts. See this API for specific function definitions.

nlp_architect.models

Model classes stores a list of layers describing the model. Methods are provided to train the model weights, perform inference, and save/load the model.

nlp_architect.models.bist_parser.BISTModel

BIST parser model class.

nlp_architect.models.chunker.SequenceChunker

A sequence Chunker model written in Tensorflow (and Keras) based SequenceTagger model.

nlp_architect.models.intent_extraction.Seq2SeqIntentModel

Encoder Decoder Deep LSTM Tagger Model (using tf.keras)

nlp_architect.models.intent_extraction.MultiTaskIntentModel

Multi-Task Intent and Slot tagging model (using tf.keras)

nlp_architect.models.matchlstm_ansptr.MatchLSTMAnswerPointer

Defines end to end MatchLSTM and Answer_Pointer network for Reading Comprehension

nlp_architect.models.memn2n_dialogue.MemN2N_Dialog

End-To-End Memory Network.

nlp_architect.models.most_common_word_sense.MostCommonWordSense

nlp_architect.models.ner_crf.NERCRF

Bi-LSTM NER model with CRF classification layer (tf.keras model)

nlp_architect.models.np2vec.NP2vec

Initialize the np2vec model, train it, save it and load it.

nlp_architect.models.np_semantic_segmentation.NpSemanticSegClassifier

NP Semantic Segmentation classifier model (based on tf.Keras framework).

nlp_architect.models.temporal_convolutional_network.TCN

This class defines core TCN architecture.

nlp_architect.models.crossling_emb.WordTranslator

Main network which does cross-lingual embeddings training

nlp_architect.models.cross_doc_sieves

nlp_architect.models.cross_doc_coref.sieves_config.EventSievesConfiguration

nlp_architect.models.cross_doc_coref.sieves_config.EntitySievesConfiguration

nlp_architect.models.cross_doc_coref.sieves_resource.SievesResources

nlp_architect.models.gnmt_model.GNMTModel

Sequence-to-sequence dynamic model with GNMT attention architecture with sparsity policy support.

nlp_architect.data

Dataset implementations and data loaders (check deep learning framework compatibility of dataset/loader in documentation)

nlp_architect.data.amazon_reviews.Amazon_Reviews

Take the *.json file of Amazon reviews as downloaded from http://jmcauley.ucsd.edu/data/amazon/ Then does data cleaning and balancing, as well as transforms the reviews 1-5 to a sentiment

nlp_architect.data.babi_dialog.BABI_Dialog

This class loads in the Facebook bAbI goal oriented dialog dataset and vectorizes them into user utterances, bot utterances, and answers.

nlp_architect.data.conll.ConllEntry

nlp_architect.data.intent_datasets.IntentDataset

Intent extraction dataset base class

nlp_architect.data.intent_datasets.TabularIntentDataset

Tabular Intent/Slot tags dataset loader.

nlp_architect.data.intent_datasets.SNIPS

SNIPS dataset class

nlp_architect.data.ptb.PTBDataLoader

Class that defines data loader

nlp_architect.data.sequential_tagging.CONLL2000

CONLL 2000 POS/chunking task data set (numpy)

nlp_architect.data.sequential_tagging.SequentialTaggingDataset

Sequential tagging dataset loader.

nlp_architect.data.fasttext_emb.FastTextEmb

Downloads FastText Embeddings for a given language to the given path.

nlp_architect.data.cdc_resources.relations.computed_relation_extraction.ComputedRelationExtraction

Extract Relation between two mentions according to computation and rule based algorithms

nlp_architect.data.cdc_resources.relations.referent_dict_relation_extraction.ReferentDictRelationExtraction

nlp_architect.data.cdc_resources.relations.verbocean_relation_extraction.VerboceanRelationExtraction

nlp_architect.data.cdc_resources.relations.wikipedia_relation_extraction.WikipediaRelationExtraction

nlp_architect.data.cdc_resources.relations.within_doc_coref_extraction.WithinDocCoref

nlp_architect.data.cdc_resources.relations.word_embedding_relation_extraction.WordEmbeddingRelationExtraction

nlp_architect.data.cdc_resources.relations.wordnet_relation_extraction.WordnetRelationExtraction

nlp_architect.data.cdc_resources.relations.relation_types_enums.RelationType

An enumeration.

nlp_architect.pipelines

NLP pipelines modules using NLP Architect models

nlp_architect.pipelines.spacy_bist.SpacyBISTParser

Main class which handles parsing with Spacy-BIST parser.

nlp_architect.pipelines.spacy_np_annotator.NPAnnotator

Spacy based NP annotator - uses models.SequenceChunker model for annotation

nlp_architect.pipelines.spacy_np_annotator.SpacyNPAnnotator

Simple Spacy pipe with NP extraction annotations

nlp_architect.contrib

In addition to imported layers, the library also contains its own set of network layers and additions. These are currently stored in the various models or related to which DL frameworks it was based on.

nlp_architect.contrib.tensorflow.python.keras.layers.crf.CRF

Conditional Random Field layer (tf.keras) CRF can be used as the last layer in a network (as a classifier).

nlp_architect.contrib.tensorflow.python.keras.utils.layer_utils.save_model

Save a model to a file (tf.keras models only) The method save the model topology, as given as a :param model: model object :param topology: a dictionary of topology elements and their values :type topology: dict :param filepath: path to save model :type filepath: str

nlp_architect.contrib.tensorflow.python.keras.utils.layer_utils.load_model

Load a model (tf.keras) from disk, create topology from loaded values and load weights.

nlp_architect.contrib.tensorflow.python.keras.callbacks.ConllCallback

A Tensorflow(Keras) Conlleval evaluator.

nlp_architect.common

Common types of data structures used by NLP models

nlp_architect.common.core_nlp_doc.CoreNLPDoc

Object for core-components (POS, Dependency Relations, etc).

nlp_architect.common.high_level_doc.HighLevelDoc

object for annotation documents

nlp_architect.common.cdc.mention_data.MentionDataLight

nlp_architect.common.cdc.mention_data.MentionData